package br.com.mensageiro.apresentacao.mensagens;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

import org.springframework.stereotype.Repository;

@Repository("addMensagem")
public class MensagemJSF {

	public void addInfo(String summary) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
				summary, null);
		FacesContext.getCurrentInstance().addMessage(null, message);
	}

	public void addWarn(String summary) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN,
				summary, null);
		FacesContext.getCurrentInstance().addMessage(null, message);
	}

	public void addError(String summary) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
				summary, null);
		FacesContext.getCurrentInstance().addMessage(null, message);
	}

	public void addFatal(String summary) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_FATAL,
				summary, null);
		FacesContext.getCurrentInstance().addMessage(null, message);
	}
}
